const path = require('path')
const buildPath = '../static'
module.exports = {
  outputDir: path.resolve(__dirname, `${buildPath}`),
  assetsDir: 'assets',
  publicPath: './',
  productionSourceMap: false,
  lintOnSave: false,
  configureWebpack: (config) => {
    // config.plugins = [compress]
    config.resolve = { // 配置解析别名
      extensions: ['.js', '.json', '.vue', '.less', '.ts'], // 自动添加文件名后缀
      alias: {
        '@': path.resolve(__dirname, './src')
      }
    }
  },
  chainWebpack: config => {
    config.optimization.minimize(true)
      .mergeDuplicateChunks(true)
      .removeEmptyChunks(true)
      .removeAvailableModules(true)
      .splitChunks({
        chunks: 'all'
      })
  }
  // 输出文件目录
  // indexPath: '../templates/index.html',
  // assetsDir: './'
}
